Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in value attributes #317

Merged
merged 2 commits into from
Apr 15, 2024
Merged

Fix bug in value attributes #317

merged 2 commits into from
Apr 15, 2024

Conversation

wsargent
Copy link
Collaborator

No description provided.

return builder.toString();
}

// if the field has elided, tostringvalue, abbreviateafter, or ascardinal,
// it should apply to the value instead.
Attributes collectValueAttributes(Attributes fa, Attributes valueAttributes) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a fallback for fields that have attributes set on them that really only apply to the value.

@@ -28,10 +28,26 @@ public String formatField(@NotNull Field field) {
assert fieldVisitor != null;
field = fieldVisitor.visit(field);
}
formatValue(builder, field.value(), attributes);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be using the value's attributes, not the field's attributes

@@ -135,7 +151,7 @@ private void formatObject(@NotNull StringBuilder b, @NotNull Value.ObjectValue v
assert fieldVisitor != null;
field = fieldVisitor.visit(field);
}
formatValue(b, field.value(), attributes);
formatValue(b, field.value(), field.value().attributes());
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the value's attributes.

@wsargent wsargent merged commit 9ec662b into main Apr 15, 2024
1 check passed
@wsargent wsargent deleted the value-attribute-formatter branch April 15, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant